<template>
  <el-breadcrumb separator-class="el-icon-arrow-right">
    <el-breadcrumb-item  v-for="(route, index) in menus" :key="index">{{route.name}}</el-breadcrumb-item>
  </el-breadcrumb>
</template>

<script>
import Bus from '@/assets/bus'
export default {
  name: '',
  data () {
    return {
      menus: []
    }
  },
  mounted: function () {
    // 用$on事件来接收参数
    let _self = this
    Bus.$on('menus', (data) => {
      // console.log(data)
      _self.menus = data
    })
  }
}

</script>
<style>
.el-breadcrumb{
  position: fixed;
  background-color: #fff;
  width: 100%;
  height: 40px;
  top: 60px;
  line-height: 40px;
}
</style>
